package com.sp.system.user.customer.controller;

import com.sp.system.user.core.annotation.NotAuthentication;
import com.sp.system.user.core.utils.ContentResult;
import com.sp.system.user.core.zookeeper.ZookeeperClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.zookeeper.CreateMode;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Describle  zookeeper 管理监控
 * @author chenanhai
 * @date 2019年10月9日
 */
@Slf4j
@RequestMapping("/zookeeper")
@RestController
public class ZookeeperController {

    @NotAuthentication
    @RequestMapping("/creatZkNode")
    public Object creatZkNode(){
        ZookeeperClient.getInstance().startConnection();
        ZookeeperClient.getInstance().creatNode("/services/sp-cus/user/c","creatZkNode", CreateMode.EPHEMERAL);
        return ContentResult.successResult(null,"");
    }
}
